package com.rx.biz.sys;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;
import org.springside.modules.orm.hibernate.HibernateDao;

import com.rx.biz.BaseBiz;
import com.rx.dao.sys.UserDao;
import com.rx.entity.sys.User;

@Repository
public class UserBiz extends BaseBiz<User, Long> {

	@Resource(name = "userDao")
	public void setDao(HibernateDao<User, Long> dao) {
		super.dao = dao;
	}

	/**
	 * 通过账号获取用户信息
	 * 
	 * @param userName
	 *            账号
	 * @return
	 */
	public User findUserByUserName(String userName) {
		return ((UserDao) dao).findUserByUserName(userName);
	}

	/**
	 * 通过账号和密码获取用户信息
	 * 
	 * @param userName
	 *            账号
	 * @param passWord
	 *            密码
	 * @return
	 */
	public User findUserByUserNameAndPassWord(String userName, String passWord) {
		return ((UserDao) dao)
				.findUserByUserNameAndPassWord(userName, passWord);
	}

}